import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.read_excel('附件1.xlsx', sheet_name='A市涉疫场所分布')
a = len(df['通报日期'])
df2 = pd.DataFrame()
for i in range(0, a):
    if int(df.iloc[i, 1]) <= int('8'):
        df1 = df.iloc[i]
        df2 = df2.append(df1)

# df3 = pd.DataFrame()
# for i in range(0, a):
#     if int(df.iloc[i, 1]) <= int('10'):
#         df1 = df.iloc[i]
#         df3 = df3.append(df1)
m = []
for i in df2['横坐标（公里）']:
    m.append(i)
n = []
for i in df2['纵坐标（公里）']:
    n.append(i)
x = np.array(m)
y = np.array(n)
plt.scatter(x, y, s=50, label='A市疫情传播风险区域', color='red')
ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.spines['bottom'].set_position(('data', 0))
ax.spines['left'].set_position(('data', 0))
#plt.title('A市6日疫情传播风险区域')
plt.show()
